package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.Map;

@Mapper
public interface UserMapper {
    /**
     * 根据openid查询数据
     * @param openId
     * @return
     */
    @Select("select * from user where openid = #{openId}")
    User selectByOpenId(String openId);


    /**
     * 插入数据
     * @param user
     */
    void insert(User user);

    /**
     * 根据Id获取数据
     * @param id
     * @return
     */
    @Select(("select * from user where id = #{id}"))
    User getById(Long id);

    /**
     * 根据时间区间统计用户数量
     * @param map
     * @return
     */
    Integer countByMap(Map map);
}
